package com.twotwoshop.service.goods.controller;

import com.twotwoshop.domin.common.dtos.ResponseResult;
import com.twotwoshop.service.goods.service.BrowsingHistoryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@RequestMapping("/goods/browsinghistory")
@Slf4j
public class BrowsingHistoryController {

    private final BrowsingHistoryService browsingHistoryService;


    /*    *//**
     * 获取浏览历史的个数
     * @return
     *//*
    @GetMapping("/count")
    public ResponseResult getViewsHistory(){
        log.info("getViewsHistory 统计浏览历史个数{}");

        return browsingHistoryService.getViewsHistory();

    }*/

    /**
     * 获取浏览历史
     *
     * @return
     */
    @GetMapping("/list")
    public ResponseResult getViewsHistory() {
        log.info("getViewsHistory 统计浏览历史个数{}");

        return browsingHistoryService.getViewsHistory();
    }

    /**
     * 清空浏览历史
     *
     * @return
     */
    @PostMapping("/clear")
    public ResponseResult clearViewsHistory() {
        log.info("clearViewsHistory 清空浏览历史{}");

        return browsingHistoryService.clearViewsHistory();
    }

}
